package com.yisoo.ubag.product.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class BrandAndSceneTreeVo {
//    value: 'navigation',
//    label: 'Navigation',
//    children: [{
    private Long value;
    private String label;
    private List<SceneTreeVo> children;


    //向children 添加数据
    public  void setChildrenItem(SceneTreeVo sceneTreeVo){
        this.children.add(sceneTreeVo);
    }

    //检查是否含有value == bid 的数据
    public static Boolean hasBrand(List<BrandAndSceneTreeVo> list,Long bid){
        for (BrandAndSceneTreeVo c:
            list ) {
            if(c.getValue() == bid){
                return true;
            }
        }
        return false;
    }

}
